home *** CD-ROM | disk | FTP | other *** search
/ Aminet 38 / Aminet 38 (2000)(Schatztruhe)[!][Aug 2000].iso / Aminet / dev / c / CLib-SDI.lha / CLib-SDI / libsource / libinfo.h < prev    next >
Encoding:
C/C++ Source or Header  |  2000-06-25  |  2.6 KB  |  94 lines

  1. #ifndef EXAMPLE_LIBINFO_C
  2. #define EXAMPLE_LIBINFO_C
  3.  
  4. /* Programmheader
  5.  
  6.     Name:        libinfo.c
  7.     Main:        example
  8.     Versionstring:    $VER: libinfo.c 1.0 (25.06.2000)
  9.     Author:        SDI
  10.     Distribution:    Freeware
  11.     Description:    the example library definition file
  12.  
  13.  1.0   25.06.00 : created that example library code
  14. */
  15.  
  16. #include <exec/libraries.h>
  17. #include <dos/dos.h>
  18. #include "SDI_compiler.h"
  19.  
  20. #define VERSION   1
  21. #define REVISION  0
  22. #define DATETXT      "25.06.2000"
  23. #define VERSTXT      "1.0"
  24.  
  25. #define LIBNAME   "example.library"
  26.  
  27. #ifdef _M68060
  28.   #define ADDTXT    " 060"
  29. #elif defined(_M68040)
  30.   #define ADDTXT    " 040"
  31. #elif defined(_M68030)
  32.   #define ADDTXT    " 030"
  33. #elif defined(_M68020)
  34.   #define ADDTXT    " 020"
  35. #else
  36.   #define ADDTXT    ""
  37. #endif
  38.  
  39. #define IDSTRING "example " VERSTXT " (" DATETXT ")" ADDTXT "\r\n"
  40. /************************************************************************
  41. *                                                *
  42. *    SegList pointer definition                        *
  43. *                                                *
  44. ************************************************************************/
  45.  
  46. #if defined(_AROS)
  47.   typedef struct SegList * SEGLISTPTR;
  48. #elif defined(__VBCC__)
  49.   typedef APTR SEGLISTPTR;
  50. #else
  51.   typedef BPTR SEGLISTPTR;
  52. #endif
  53.  
  54. /************************************************************************
  55. *                                                *
  56. *    library base structure                        *
  57. *                                                *
  58. ************************************************************************/
  59.  
  60. /* This is the private structure. The official one does not contain all
  61. the private fields! */
  62. struct ExampleBaseP {
  63.   struct Library         exb_LibNode;
  64.   ULONG                  exb_NumCalls;
  65.  
  66.   struct ExecBase *      exb_SysBase;
  67.   struct IntuitionBase * exb_IntuitionBase;
  68.   SEGLISTPTR             exb_SegList;
  69. };
  70.  
  71. #if defined(BASE_GLOABL)
  72.   extern struct ExecBase      * SysBase;
  73.   extern struct IntuitionBase * IntuitionBase;
  74.   extern struct ExampleBase   * ExampleBase;
  75. #elif defined(BASE_REDEFINE)
  76.   #define SysBase       ExampleBase->exb_SysBase
  77.   #define IntuitionBase ExampleBase->exb_IntuitionBase
  78. #endif
  79.  
  80. /************************************************************************
  81. *                                                *
  82. *    library accessable function                    *
  83. *                                                *
  84. ************************************************************************/
  85.  
  86. ASM(LONG) LIBex_TestRequest(REG(a0, UBYTE *title), REG(a1, UBYTE *body),
  87. REG(a2, UBYTE *gadgets), REG(a6, struct ExampleBaseP *ExampleBase));
  88.  
  89. ASM(LONG) LIBex_TestRequest2A(REG(a0, STRPTR title), REG(a1, STRPTR body),
  90. REG(a2, STRPTR gadgets), REG(a3, APTR args),
  91. REG(a6, struct ExampleBaseP *ExampleBase));
  92.  
  93. #endif /* EXAMPLE_LIBINFO_C */
  94.